import systemIcons from "@/config/systemIcons";
import {baseUrl} from "@/config/env";

export const dateTypes = [
    {label: 'String', value: 'java.lang.String'},
    {label: 'Integer', value: 'java.lang.Integer'},
    {label: 'Long', value: 'java.lang.Long'},
    {label: 'Short', value: 'java.lang.Short'},
    {label: 'Double', value: 'java.lang.Double'},
    {label: 'Float', value: 'java.lang.Float'},
    {label: 'Boolean', value: 'java.lang.Boolean'},
    {label: 'Byte', value: 'java.lang.Byte'},
    {label: 'Character', value: 'java.lang.Character'},
    {label: 'Date', value: 'java.util.Date'},
    {label: 'LocalTime', value: 'java.time.LocalTime'},
    {label: 'LocalDateTime', value: 'java.time.LocalDateTime'},
    {label: 'LocalDate', value: 'java.time.LocalDate'},

]
export const formFieldHandlerState = {
    display: [{label: "可见", value: true}, {label: "不可见", value: false}],
    disabled: [{label: "可用", value: false}, {label: "禁用", value: true}],
    search: [{label: "启用", value: true}, {label: "禁用", value: false}],
    hide: [{label: "隐藏", value: true}, {label: "显示", value: false}],
    searchModels: [
        {label: "等于", value: "#{0}"},
        {label: "大于", value: "#{1}"},
        {label: "大于等于", value: "#{2}"},
        {label: "小于", value: "#{3}"},
        {label: "小于等于", value: "#{4}"},
        {label: "不等于", value: "#{5}"},
        {label: "包含", value: "#{8}"},
        {label: "不包含", value: "#{9}"},
        {label: "左模糊", value: "#{10}"},
        {label: "右模糊", value: "#{11}"},
    ],
}


export default [
    // {
    //     title: '布局字段',
    //     list: [
    //         {
    //             type: 'group',
    //             label: '分组',
    //             icon: 'icon-group',
    //             display: true,
    //             arrow: false,
    //             collapse: true,
    //             children: {
    //                 column: []
    //             }
    //         }, {
    //             type: 'dynamic',
    //             label: '子表单',
    //             icon: 'icon-table',
    //             span: 24,
    //             display: true,
    //             children: {
    //                 align: 'center',
    //                 headerAlign: 'center',
    //                 index: false,
    //                 addBtn: true,
    //                 delBtn: true,
    //                 column: []
    //             }
    //         }, {
    //             type: 'title',
    //             icon: 'icon-title',
    //             span: 24,
    //             display: true,
    //             styles: {
    //                 fontSize: '18px',
    //                 color: '#000'
    //             },
    //             label: '标题',
    //             labelWidth: '0px',
    //             value: '标题',
    //         }]
    // },
    {
        title: '输入字段',
        list: [{
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            searchLabelWidth: 120,
            type: 'input',
            label: '单行文本',
            icon: 'icon-input',
            span: 24,
            display: true
        }, {
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'password',
            searchLabelWidth: 120,
            label: '密码',
            icon: 'icon-password',
            span: 24,
            display: true
        }, {
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'textarea',
            searchLabelWidth: 120,
            label: '多行文本',
            icon: 'icon-textarea',
            span: 24,
            display: true
        }, {
            sqlType: 'java.lang.Integer',
            sqlTypeDataLength: 255,
            type: 'number',
            searchLabelWidth: 120,
            label: '计数器',
            icon: 'icon-number',
            min: 0,
            controls: true,
            span: 24,
            display: true,
        },
            //     {
            //     sqlType: 'java.lang.String',
            //     sqlTypeDataLength: 255,
            //     type: 'url',
            //     searchLabelWidth: 120,
            //     label: '超链接',
            //     icon: 'icon-url',
            //     span: 24,
            //     display: true
            // },
            //{
            //     sqlType: 'java.lang.String',
            //     sqlTypeDataLength: 255,
            //     type: 'array',
            //     label: '数组',
            //     searchLabelWidth: 120,
            //     icon: 'icon-array',
            //     span: 24,
            //     display: true,
            // },
            //     {
            //     sqlType: 'java.lang.String',
            //     sqlTypeDataLength: 255,
            //     type: 'img',
            //     searchLabelWidth: 120,
            //     label: '图片',
            //     icon: 'icon-img',
            //     span: 24,
            //     display: true,
            // },
            {
                sqlType: 'java.lang.String',
                sqlTypeDataLength: 255,
                type: 'map',
                component: 'avue-input-map',
                label: '地图选择器',
                icon: 'icon-map',
                searchLabelWidth: 120,
                span: 24,
                display: true
            }]
    },
    {
        title: '选择字段',
        sqlType: 'java.lang.String',
        sqlTypeDataLength: 255,
        list: [{
            type: 'radio',
            label: '单选框组',
            icon: 'icon-radio',
            searchLabelWidth: 120,
            dicData: [
                {label: '选项一', value: '0'},
                {label: '选项二', value: '1'},
                {label: '选项三', value: '2'},
            ],
            span: 24,
            display: true,
            dicOption: 'static',
            props: {
                label: 'label',
                value: 'value'
            }
        }, {
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'checkbox',
            label: '多选框组',
            searchLabelWidth: 120,
            icon: 'icon-checkbox',
            dicData: [
                {label: '选项一', value: '0'},
                {label: '选项二', value: '1'},
                {label: '选项三', value: '2'},
            ],
            span: 24,
            display: true,
            dicOption: 'static',
            props: {
                label: 'label',
                value: 'value'
            }
        }, {
            type: 'select',
            label: '下拉选择器',
            icon: 'icon-select',
            searchLabelWidth: 120,
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            dicData: [
                {label: '选项一', value: "0"},
                {label: '选项二', value: "1"},
                {label: '选项三', value: "2"},
            ],
            // 用于做级联配置
            cascaderItem: [],
            span: 24,
            display: true,
            dicOption: 'static',
            props: {
                label: 'label',
                value: 'value'
            }
        }, {
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'cascader',
            searchLabelWidth: 120,
            label: '级联选择器',
            icon: 'icon-link',
            span: 24,
            display: true,
            dicData: [
                {
                    label: '选项一',
                    value: "0",
                    children: [{
                        label: '选项1-1',
                        value: "11",
                    }, {
                        label: '选项1-2',
                        value: "12",
                    }]
                },
                {label: '选项二', value: 1},
                {label: '选项三', value: 2},
            ],
            cascaderIndex: 1,
            showAllLevels: true,
            dicOption: 'static',
            separator: "/",
            props: {
                label: 'label',
                value: 'value'
            }
        }, {
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'tree',
            label: '树形选择器',
            icon: 'icon-tree',
            searchLabelWidth: 120,
            span: 24,
            display: true,
            dicOption: 'static',
            dicData: [
                {
                    label: '选项一',
                    value: "0",
                    children: [{
                        label: '选项1-1',
                        value: "11",
                    }, {
                        label: '选项1-2',
                        value: "12",
                    }]
                },
                {label: '选项二', value: "1"},
                {label: '选项三', value: "2"},
            ],
            parent: true,
            props: {
                label: 'label',
                value: 'value'
            }
        }]
    },
    {
        title: '上传字段',
        sqlType: 'java.lang.String',
        sqlTypeDataLength: 255,
        list: [{
            type: 'upload',
            label: '上传',
            icon: 'icon-upload',
            span: 24,
            display: true,
            showFileList: true,
            multiple: true,

            searchLabelWidth: 120,
            // props: {},
            limit: 10,
            propsHttp: {
                name: 'fileName',
                res: 'data',
                url: 'fileUrl',
            },
            canvasOption: {},
            headersConfig: [],
            dataConfig: [],
            action: `${baseUrl}/staticResources/upload`
        }],
    },
    {
        title: '日期时间字段',

        list: [{
            type: 'year',
            label: '年',
            icon: 'icon-year',
            span: 24,
            searchLabelWidth: 120,
            display: true,
            format: 'yyyy',
            valueFormat: 'yyyy',
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
        }, {
            type: 'month',
            label: '月',
            icon: 'icon-month',
            span: 24,
            display: true,
            format: 'MM',
            searchLabelWidth: 120,
            valueFormat: 'MM',
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
        }, {
            type: 'week',
            label: '周',
            icon: 'icon-week',
            span: 24,
            display: true,
            format: 'yyyy 第 WW 周',
            sqlType: 'java.lang.String',
            searchLabelWidth: 120,
            sqlTypeDataLength: 255,
        }, {
            type: 'date',
            label: '日期',
            icon: 'icon-date',
            span: 24,
            display: true,
            format: 'yyyy-MM-dd',
            valueFormat: 'yyyy-MM-dd',
            sqlType: 'java.util.Date',
            sqlTypeDataLength: 255,
        }, {
            type: 'time',
            label: '时间',
            icon: 'icon-time',
            span: 24,
            display: true,
            searchLabelWidth: 120,
            format: 'HH:mm:ss',
            valueFormat: 'HH:mm:ss',
            sqlType: 'java.util.Date',
            sqlTypeDataLength: 255,
        }, {
            type: 'datetime',
            label: '日期时间',
            icon: 'icon-datetime',
            span: 24,
            searchLabelWidth: 120,
            display: true,
            format: 'yyyy-MM-dd HH:mm:ss',
            valueFormat: 'yyyy-MM-dd HH:mm:ss',
            sqlType: 'java.util.Date',
            sqlTypeDataLength: 255,
        }, {
            type: 'daterange',
            label: '日期范围',
            icon: 'icon-date-range',
            span: 24,
            display: true,
            searchLabelWidth: 120,
            format: 'yyyy-MM-dd',
            valueFormat: 'yyyy-MM-dd',
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
        }, {
            type: 'timerange',
            label: '时间范围',
            icon: 'icon-time-range',
            span: 24,
            display: true,
            format: 'HH:mm:ss',
            searchLabelWidth: 120,
            valueFormat: 'HH:mm:ss',
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
        }, {
            type: 'datetimerange',
            label: '日期时间范围',
            icon: 'icon-datetime-range',
            span: 24,
            display: true,
            searchLabelWidth: 120,
            format: 'yyyy-MM-dd HH:mm:ss',
            valueFormat: 'yyyy-MM-dd HH:mm:ss',
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
        }],
    },
    {
        title: '插件字段（富文本需要单独引入）',
        list: [{
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            title: '日历',
            searchLabelWidth: 120,
            component: 'elCalendar',//ele日期
            labelWidth: '40',
            icon: 'icon-map',
            span: 24,
            params: {}
        },
            {
                type: 'ueditor',
                component: 'avue-ueditor',
                label: '富文本',
                icon: 'icon-richtext',
                searchLabelWidth: 120,
                span: 24,
                display: true,
                sqlType: 'java.lang.String',
                sqlTypeDataLength: 255,
                options: {
                    action: '',
                    oss: '',
                    props: {},
                    ali: {},
                    qiniu: {}
                }
            }
        ],
    },
    {
        title: '其他字段',
        list: [{
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'icon',
            label: '图标',
            searchLabelWidth: 120,
            component: 'avue-input-icon',
            icon: 'icon-icon',
            span: 24,
            display: true,

            params: {
                iconList: systemIcons
            }
        }, {
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'switch',
            label: '开关',
            icon: 'icon-switch',
            span: 24,
            searchLabelWidth: 120,
            display: true,
            value: 0,
            dicData: [{label: '', value: '0'}, {label: '', value: '1'}]
        }, {
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'rate',
            label: '评价',
            icon: 'icon-star',
            span: 24,
            display: true,
            max: 5,
            searchLabelWidth: 120,
            value: 0,
            texts: ['极差', '失望', '一般', '满意', '惊喜'],
            colors: ['#99A9BF', '#F7BA2A', '#FF9900'],
        }, {
            sqlType: 'java.lang.Integer',
            sqlTypeDataLength: 255,
            type: 'slider',
            label: '滑块',
            icon: 'icon-slider',
            span: 24,
            display: true,
            searchLabelWidth: 120,
            min: 0,
            max: 10
        }, {
            sqlType: 'java.lang.String',
            sqlTypeDataLength: 255,
            type: 'color',
            label: '颜色选择器',
            icon: 'icon-color',
            searchLabelWidth: 120,
            span: 24,
            display: true
        }]
    }
]
